B) If we were using prefer_shortname and had a description we'd free
shortname twice, resulting in a process that would never exit becuase
of heap corruption on FC2. (Other OSes would surely have similarly
entertaing failure modes.)
if (description) {
xfree(description);
}
- description = shortname;
- }
-
- if (description) {
+ description = shortname;
+ } else if (description) {
char *odesc = description;
description = str_utf8_to_ascii(odesc);
xfree(odesc);
fprintf (xcsv_file.xcsvfp, "%s", xcsv_file.record_delimiter);
- if (shortname)
- xfree(shortname);
-
if (description && description != shortname)
xfree(description);
+ if (shortname)
+ xfree(shortname);
+
/* increment the index counter */
waypt_out_count++;
}